﻿<!--_meta 作为公共模版分离出去-->
<!DOCTYPE HTML>
<html>
<head>
    <!--_meta 作为公共模版分离出去-->
    <% layout("/common/_meta.html",{title:"权限管理"}){} %>
    <!--_meta 作为公共模版分离出去-->
    <%
    var isAddBtn = satoken.hasPermission("permission:add");
    var isUpdateBtn = satoken.hasPermission("permission:update");
    var isDeleteBtn = satoken.hasPermission("permission:delete");
    %>
</head>
<body>
<div class="wap-container">
    <nav class="breadcrumb" style="background-color:#fff;padding: 0 24px">首页<span class="c-gray en">/</span>用户管理<span class="c-gray en">/</span>权限管理<a class="btn btn-success radius f-r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新"><i class="Hui-iconfont">&#xe68f;</i></a></nav>
    <article class="Hui-admin-content clearfix">
        <div class="panel mt-20">
            <div class="panel-body">
                <div class="clearfix">
                    <span class="f-l">
                        <%if(isAddBtn){%>
                            <button onclick="layer_show('添加权限','${ctxPath}/permission/addForm')" class="btn btn-primary radius" type="button"><i class="Hui-iconfont">&#xe600;</i> 添加权限</button>
                        <%}%>
                    </span>
                    <span class="f-r">

                    </span>
                </div>
                <div class="mt-20 clearfix">
                    <table class="table table-border table-bordered table-bg table-hover table-striped">
                        <thead>
                            <tr class="text-c">
                                <th>ID</th>
                                <th colspan="3">名称</th>
                                <th>编码</th>
                                <th>图标</th>
                                <th>链接</th>
                                <th>上级ID</th>
                                <th>显示菜单</th>
                                <th>排序</th>
                                <th>操作</th>
                            </tr>
                        </thead>
                        <tbody>
                        <%for(top in tops){%>
                            <tr class="text-c">
                                <td>${top.id}</td>
                                <td>${top.name}</td>
                                <td></td>
                                <td></td>
                                <td>${top.code}</td>
                                <td><%if(isEmpty(top.icon) == false){%><i class="Hui-iconfont">${top.icon}</i><%}%></td>
                                <td>${top.url}</td>
                                <td>${top.parentId}</td>
                                <td>${decode(top.isLink,true,'是',false,'否','')}</td>
                                <td>${top.sort}</td>
                                <td>
                                    <%if(isUpdateBtn){%>
                                    <button onclick="layer_show('修改权限','${ctxPath}/permission/updateForm?id=${top.id}')" class="btn btn-secondary-outline size-MINI radius" type="button">修改</button>
                                    <%}%>
                                    <%if(isDeleteBtn){%>
                                    <button onclick="layer_confirm('确认删除权限？','${ctxPath}/permission/delete?id=${top.id}')" class="btn btn-danger-outline size-MINI radius" type="button">删除</button>
                                    <%}%>
                                </td>
                            </tr>
                            <%for(sec in top.children){%>
                            <tr class="text-c">
                                <td>${sec.id}</td>
                                <td></td>
                                <td>${sec.name}</td>
                                <td></td>
                                <td>${sec.code}</td>
                                <td><%if(isEmpty(sec.icon) == false){%><i class="Hui-iconfont">${sec.icon}</i><%}%></td>
                                <td>${sec.url}</td>
                                <td>${sec.parentId}</td>
                                <td>${decode(sec.isLink,true,'是',false,'否','')}</td>
                                <td>${sec.sort}</td>
                                <td>
                                    <%if(isUpdateBtn){%>
                                    <button onclick="layer_show('修改权限','${ctxPath}/permission/updateForm?id=${sec.id}')" class="btn btn-secondary-outline size-MINI radius" type="button">修改</button>
                                    <%}%>
                                    <%if(isDeleteBtn){%>
                                    <button onclick="layer_confirm('确认删除权限？','${ctxPath}/permission/delete?id=${sec.id}')" class="btn btn-danger-outline size-MINI radius" type="button">删除</button>
                                    <%}%>
                                </td>
                            </tr>
                            <%for(thd in sec.children){%>
                            <tr class="text-c">
                                <td>${thd.id}</td>
                                <td></td>
                                <td></td>
                                <td>${thd.name}</td>
                                <td>${thd.code}</td>
                                <td><%if(isEmpty(thd.icon) == false){%><i class="Hui-iconfont">${thd.icon}</i><%}%></td>
                                <td>${thd.url}</td>
                                <td>${thd.parentId}</td>
                                <td>${decode(thd.isLink,true,'是',false,'否','')}</td>
                                <td>${thd.sort}</td>
                                <td>
                                    <%if(isUpdateBtn){%>
                                    <button onclick="layer_show('修改权限','${ctxPath}/permission/updateForm?id=${thd.id}')" class="btn btn-secondary-outline size-MINI radius" type="button">修改</button>
                                    <%}%>
                                    <%if(isDeleteBtn){%>
                                    <button onclick="layer_confirm('确认删除权限？','${ctxPath}/permission/delete?id=${thd.id}')" class="btn btn-danger-outline size-MINI radius" type="button">删除</button>
                                    <%}%>
                                </td>
                            </tr>
                            <%}%>
                            <%}%>
                            <%}%>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </article>
</div>

<!--_footer 作为公共模版分离出去-->
<% layout("/common/_footer.html"){} %>
<!--/_footer 作为公共模版分离出去-->
<script type="text/javascript">
    $(function () {
        // 操作提示
        var code = $("#code").val();
        var msg = $("#msg").val();
        if (msg.length > 0) {
            layer_msg(code, msg);
        }
    });
</script>
</body>
</html>
